#Linux： 后面的值为要使用的GPU编号，正常的话是从0开始
# export CUDA_VISIBLE_DEVICES=0
# windows: 
# set CUDA_VISIBLE_DEVICES=0


export MODEL_NAME='/mnt/afs2d/luotianhang/cache/PretrainedModels/models--runwayml--stable-diffusion-inpainting/snapshots/afeee10def38be19995784bcc811882409d066e5'
export CONTROLNET_NAME=''
export CONTROLNET_FROM_TEXT2IMAGE='/mnt/afs2d/luotianhang/cache/PretrainedModels/stable-diffusion-v1-5/stable-diffusion-v1-5'
accelerate launch  train_inpainting2.py \
    --pretrained_model_name_or_path=$MODEL_NAME \
    --resolution=512  \
    --train_batch_size=4 --gradient_accumulation_steps=1 --gradient_checkpointing \
    --max_train_steps=250000 \
    --checkpointing_steps=500 \
    --checkpoints_total_limit=2 \
    --learning_rate=1e-05 --max_grad_norm=1 --lr_warmup_steps=0 \
    --seed=423 \
    --output_dir=controlnet_experiment_inpainting \
    --enable_xformers_memory_efficient_attention \
    --use_8bit_adam   \
    --dataloader_num_workers=2 \
    --enable_xformers_memory_efficient_attention \
    --controlnet_unet=$CONTROLNET_FROM_TEXT2IMAGE

